apiready = function () {
  api.parseTapmode();
  var header = $api.byId('aui-header');
  FastClick.attach(document.body);
  $api.fixStatusBar(header);
  api.setRefreshHeaderInfo({
      loadingImg: 'widget://image/refresh.png',
      bgColor: '#fdd903',
      textColor: '#fff',
      textDown: '下拉刷新...',
      textUp: '松开刷新...'
  }, function(ret, err) {

    app.vm.pageUser.getUserInfo()
      //在这里从服务器加载数据，加载完成后调用api.refreshHeaderLoadDone()方法恢复组件到默认状态
  });
  app.vm.pageUser = new Vue({
      el: '#pageUser',
      data: {
        user_info: {}
      },
      created: function() {
        this.getUserInfo();
      },
     methods: {
       getUserInfo:function(){
           var that = this;
           app.get("api/user/info",{
             fields:'name,store.store_name,nickname,avatarUrl,phone'
           }, function (res) {
             if (res.code != 200) {
               app.alert(res.msg);
               return;
             }
             that.user_info=res.data;
               api.refreshHeaderLoadDone();
           });
      },
      openWebView:function(url){
        app.checkMerchantId();
        webView(url);
      }

     }
  })
}
